<!-- HTML header for doxygen 1.8.13-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.9.2"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Secure Sockets: Functions</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen_style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><a href="http://www.cypress.com/"><img alt="Logo" src="cypress_logo.png"/></a></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">Secure Sockets</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.2 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search",'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(document).ready(function(){initNavTree('group__group__cy__tls__functions.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle"><div class="title">Functions<div class="ingroups"><a class="el" href="group__group__cy__tls.html">TLS API</a></div></div></div>
</div><!--header-->
<div class="contents">
<a name="details" id="details"></a><h2 class="groupheader">General Description</h2>
<p >All the API functions except <a class="el" href="group__group__cy__tls__functions.html#gaa78e119aa59d26d68ff2e879d55cdac8">cy_tls_init</a> <a class="el" href="group__group__cy__tls__functions.html#gaccea15eaf0ad36001b914bd53b327a84">cy_tls_deinit</a> <a class="el" href="group__group__cy__tls__functions.html#ga186918ab7a9c658fb7e3cc6f00e0d6d9">cy_tls_load_global_root_ca_certificates</a> and <a class="el" href="group__group__cy__tls__functions.html#ga5e76c0d24388071a0ba60b38a9367bd0">cy_tls_release_global_root_ca_certificates</a> are thread-safe. </p>
<p >All the API functions are blocking API functions. </p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="func-members" name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:gaa78e119aa59d26d68ff2e879d55cdac8"><td class="memItemLeft" align="right" valign="top">cy_rslt_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__cy__tls__functions.html#gaa78e119aa59d26d68ff2e879d55cdac8">cy_tls_init</a> (void)</td></tr>
<tr class="memdesc:gaa78e119aa59d26d68ff2e879d55cdac8"><td class="mdescLeft">&#160;</td><td class="mdescRight">Does general allocation and initialization of resources needed for the library.  <a href="group__group__cy__tls__functions.html#gaa78e119aa59d26d68ff2e879d55cdac8">More...</a><br /></td></tr>
<tr class="separator:gaa78e119aa59d26d68ff2e879d55cdac8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaccea15eaf0ad36001b914bd53b327a84"><td class="memItemLeft" align="right" valign="top">cy_rslt_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__cy__tls__functions.html#gaccea15eaf0ad36001b914bd53b327a84">cy_tls_deinit</a> (void)</td></tr>
<tr class="memdesc:gaccea15eaf0ad36001b914bd53b327a84"><td class="mdescLeft">&#160;</td><td class="mdescRight">Releases the resources allocated in the <a class="el" href="group__group__cy__tls__functions.html#gaa78e119aa59d26d68ff2e879d55cdac8">cy_tls_init</a> function.  <a href="group__group__cy__tls__functions.html#gaccea15eaf0ad36001b914bd53b327a84">More...</a><br /></td></tr>
<tr class="separator:gaccea15eaf0ad36001b914bd53b327a84"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga186918ab7a9c658fb7e3cc6f00e0d6d9"><td class="memItemLeft" align="right" valign="top">cy_rslt_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__cy__tls__functions.html#ga186918ab7a9c658fb7e3cc6f00e0d6d9">cy_tls_load_global_root_ca_certificates</a> (const char *trusted_ca_certificates, const uint32_t cert_length)</td></tr>
<tr class="memdesc:ga186918ab7a9c658fb7e3cc6f00e0d6d9"><td class="mdescLeft">&#160;</td><td class="mdescRight">Initializes the global trusted RootCA certificates used for verifying certificates received during TLS handshake.  <a href="group__group__cy__tls__functions.html#ga186918ab7a9c658fb7e3cc6f00e0d6d9">More...</a><br /></td></tr>
<tr class="separator:ga186918ab7a9c658fb7e3cc6f00e0d6d9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga5e76c0d24388071a0ba60b38a9367bd0"><td class="memItemLeft" align="right" valign="top">cy_rslt_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__cy__tls__functions.html#ga5e76c0d24388071a0ba60b38a9367bd0">cy_tls_release_global_root_ca_certificates</a> (void)</td></tr>
<tr class="memdesc:ga5e76c0d24388071a0ba60b38a9367bd0"><td class="mdescLeft">&#160;</td><td class="mdescRight">Releases the resources allocated by the <a class="el" href="group__group__cy__tls__functions.html#ga186918ab7a9c658fb7e3cc6f00e0d6d9">cy_tls_load_global_root_ca_certificates</a> API function.  <a href="group__group__cy__tls__functions.html#ga5e76c0d24388071a0ba60b38a9367bd0">More...</a><br /></td></tr>
<tr class="separator:ga5e76c0d24388071a0ba60b38a9367bd0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga3d2408681bbcea3b869cb5ae21cd0d5e"><td class="memItemLeft" align="right" valign="top">cy_rslt_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__cy__tls__functions.html#ga3d2408681bbcea3b869cb5ae21cd0d5e">cy_tls_create_identity</a> (const char *certificate_data, const uint32_t certificate_len, const char *private_key, uint32_t private_key_len, void **tls_identity)</td></tr>
<tr class="memdesc:ga3d2408681bbcea3b869cb5ae21cd0d5e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Creates an identity structure from the supplied certificate and private key.  <a href="group__group__cy__tls__functions.html#ga3d2408681bbcea3b869cb5ae21cd0d5e">More...</a><br /></td></tr>
<tr class="separator:ga3d2408681bbcea3b869cb5ae21cd0d5e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga6e0540b152880d64f30eab5dfb33de2a"><td class="memItemLeft" align="right" valign="top">cy_rslt_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__cy__tls__functions.html#ga6e0540b152880d64f30eab5dfb33de2a">cy_tls_delete_identity</a> (void *tls_identity)</td></tr>
<tr class="memdesc:ga6e0540b152880d64f30eab5dfb33de2a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Releases resources allocated by the <a class="el" href="group__group__cy__tls__functions.html#ga3d2408681bbcea3b869cb5ae21cd0d5e">cy_tls_create_identity</a> API function.  <a href="group__group__cy__tls__functions.html#ga6e0540b152880d64f30eab5dfb33de2a">More...</a><br /></td></tr>
<tr class="separator:ga6e0540b152880d64f30eab5dfb33de2a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gac85f731f94c63243c2cdff8a679bb10e"><td class="memItemLeft" align="right" valign="top">cy_rslt_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__cy__tls__functions.html#gac85f731f94c63243c2cdff8a679bb10e">cy_tls_create_context</a> (<a class="el" href="group__group__cy__tls__typedefs.html#ga0d99157c08499d8a8162a01bc60120fa">cy_tls_context_t</a> *context, <a class="el" href="structcy__tls__params__t.html">cy_tls_params_t</a> *params)</td></tr>
<tr class="memdesc:gac85f731f94c63243c2cdff8a679bb10e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Creates a TLS context structure from the input parameters.  <a href="group__group__cy__tls__functions.html#gac85f731f94c63243c2cdff8a679bb10e">More...</a><br /></td></tr>
<tr class="separator:gac85f731f94c63243c2cdff8a679bb10e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaff6995a44c8fbfb011bf2f06baa27941"><td class="memItemLeft" align="right" valign="top">cy_rslt_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__cy__tls__functions.html#gaff6995a44c8fbfb011bf2f06baa27941">cy_tls_connect</a> (<a class="el" href="group__group__cy__tls__typedefs.html#ga0d99157c08499d8a8162a01bc60120fa">cy_tls_context_t</a> context, <a class="el" href="group__group__cy__tls__enums.html#gae33f7537fb953f44173ea3b6a6a1e939">cy_tls_endpoint_type_t</a> endpoint, uint32_t timeout)</td></tr>
<tr class="memdesc:gaff6995a44c8fbfb011bf2f06baa27941"><td class="mdescLeft">&#160;</td><td class="mdescRight">Performs a TLS handshake and connects to the server.  <a href="group__group__cy__tls__functions.html#gaff6995a44c8fbfb011bf2f06baa27941">More...</a><br /></td></tr>
<tr class="separator:gaff6995a44c8fbfb011bf2f06baa27941"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaf9381a19e101fdb6e47373ecbbdbc446"><td class="memItemLeft" align="right" valign="top">cy_rslt_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__cy__tls__functions.html#gaf9381a19e101fdb6e47373ecbbdbc446">cy_tls_send</a> (<a class="el" href="group__group__cy__tls__typedefs.html#ga0d99157c08499d8a8162a01bc60120fa">cy_tls_context_t</a> context, const unsigned char *data, uint32_t length, uint32_t timeout, uint32_t *bytes_sent)</td></tr>
<tr class="memdesc:gaf9381a19e101fdb6e47373ecbbdbc446"><td class="mdescLeft">&#160;</td><td class="mdescRight">Encrypts the given data and sends it over a secure connection.  <a href="group__group__cy__tls__functions.html#gaf9381a19e101fdb6e47373ecbbdbc446">More...</a><br /></td></tr>
<tr class="separator:gaf9381a19e101fdb6e47373ecbbdbc446"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga9caa9d55b4be5c4f461c0efed063b068"><td class="memItemLeft" align="right" valign="top">cy_rslt_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__cy__tls__functions.html#ga9caa9d55b4be5c4f461c0efed063b068">cy_tls_recv</a> (<a class="el" href="group__group__cy__tls__typedefs.html#ga0d99157c08499d8a8162a01bc60120fa">cy_tls_context_t</a> context, unsigned char *buffer, uint32_t length, uint32_t timeout, uint32_t *bytes_received)</td></tr>
<tr class="memdesc:ga9caa9d55b4be5c4f461c0efed063b068"><td class="mdescLeft">&#160;</td><td class="mdescRight">Reads the encrypted data from the network, decrypts the data, and then stores it in the given buffer.  <a href="group__group__cy__tls__functions.html#ga9caa9d55b4be5c4f461c0efed063b068">More...</a><br /></td></tr>
<tr class="separator:ga9caa9d55b4be5c4f461c0efed063b068"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga7bec211e84f508f82ae2092e3bd19bbf"><td class="memItemLeft" align="right" valign="top">cy_rslt_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__cy__tls__functions.html#ga7bec211e84f508f82ae2092e3bd19bbf">cy_tls_delete_context</a> (<a class="el" href="group__group__cy__tls__typedefs.html#ga0d99157c08499d8a8162a01bc60120fa">cy_tls_context_t</a> context)</td></tr>
<tr class="memdesc:ga7bec211e84f508f82ae2092e3bd19bbf"><td class="mdescLeft">&#160;</td><td class="mdescRight">Releases the resources allocated for the TLS connection.  <a href="group__group__cy__tls__functions.html#ga7bec211e84f508f82ae2092e3bd19bbf">More...</a><br /></td></tr>
<tr class="separator:ga7bec211e84f508f82ae2092e3bd19bbf"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gab7ffbf6231b73f5f44db70a6e3ac096a"><td class="memItemLeft" align="right" valign="top">cy_rslt_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__cy__tls__functions.html#gab7ffbf6231b73f5f44db70a6e3ac096a">cy_tls_config_cert_profile_param</a> (<a class="el" href="group__group__cy__tls__enums.html#gad8adf739bb77cf42fd5e0b468c6677f6">cy_tls_md_type_t</a> mds_type, <a class="el" href="group__group__cy__tls__enums.html#ga050d16fa3dbe50238685202474ddbe71">cy_tls_rsa_min_key_len_t</a> rsa_bit_len)</td></tr>
<tr class="memdesc:gab7ffbf6231b73f5f44db70a6e3ac096a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Configures a custom certificate profile using the message digest and RSA min key length.  <a href="group__group__cy__tls__functions.html#gab7ffbf6231b73f5f44db70a6e3ac096a">More...</a><br /></td></tr>
<tr class="separator:gab7ffbf6231b73f5f44db70a6e3ac096a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaac4922e98264ecb5d6dee8a81ee77cf6"><td class="memItemLeft" align="right" valign="top">cy_rslt_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__cy__tls__functions.html#gaac4922e98264ecb5d6dee8a81ee77cf6">cy_tls_is_certificate_valid_x509</a> (const char *certificate_data, const uint32_t certificate_len)</td></tr>
<tr class="memdesc:gaac4922e98264ecb5d6dee8a81ee77cf6"><td class="mdescLeft">&#160;</td><td class="mdescRight">Checks if given buffer is in valid certificate format.  <a href="group__group__cy__tls__functions.html#gaac4922e98264ecb5d6dee8a81ee77cf6">More...</a><br /></td></tr>
<tr class="separator:gaac4922e98264ecb5d6dee8a81ee77cf6"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Function Documentation</h2>
<a id="gaa78e119aa59d26d68ff2e879d55cdac8" name="gaa78e119aa59d26d68ff2e879d55cdac8"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaa78e119aa59d26d68ff2e879d55cdac8">&#9670;&nbsp;</a></span>cy_tls_init()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">cy_rslt_t cy_tls_init </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Does general allocation and initialization of resources needed for the library. </p>
<p >This API function must be called before using any other context-based TLS API functions.</p>
<dl class="section note"><dt>Note</dt><dd><ol type="1">
<li>Helper APIs <a class="el" href="group__group__cy__tls__functions.html#ga186918ab7a9c658fb7e3cc6f00e0d6d9">cy_tls_load_global_root_ca_certificates</a>, <a class="el" href="group__group__cy__tls__functions.html#ga5e76c0d24388071a0ba60b38a9367bd0">cy_tls_release_global_root_ca_certificates</a>, <a class="el" href="group__group__cy__tls__functions.html#ga3d2408681bbcea3b869cb5ae21cd0d5e">cy_tls_create_identity</a>, and <a class="el" href="group__group__cy__tls__functions.html#ga6e0540b152880d64f30eab5dfb33de2a">cy_tls_delete_identity</a> can be called without calling <a class="el" href="group__group__cy__tls__functions.html#gaa78e119aa59d26d68ff2e879d55cdac8">cy_tls_init</a>.</li>
<li><a class="el" href="group__group__cy__tls__functions.html#gaa78e119aa59d26d68ff2e879d55cdac8">cy_tls_init</a> and <a class="el" href="group__group__cy__tls__functions.html#gaccea15eaf0ad36001b914bd53b327a84">cy_tls_deinit</a> API functions are not thread-safe. The caller must ensure that these two API functions are not invoked simultaneously from different threads.</li>
</ol>
</dd></dl>
<dl class="section return"><dt>Returns</dt><dd>CY_RSLT_SUCCESS on success; an error code on failure. </dd></dl>

</div>
</div>
<a id="gaccea15eaf0ad36001b914bd53b327a84" name="gaccea15eaf0ad36001b914bd53b327a84"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaccea15eaf0ad36001b914bd53b327a84">&#9670;&nbsp;</a></span>cy_tls_deinit()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">cy_rslt_t cy_tls_deinit </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Releases the resources allocated in the <a class="el" href="group__group__cy__tls__functions.html#gaa78e119aa59d26d68ff2e879d55cdac8">cy_tls_init</a> function. </p>
<dl class="section note"><dt>Note</dt><dd><a class="el" href="group__group__cy__tls__functions.html#gaa78e119aa59d26d68ff2e879d55cdac8">cy_tls_init</a> and <a class="el" href="group__group__cy__tls__functions.html#gaccea15eaf0ad36001b914bd53b327a84">cy_tls_deinit</a> API functions are not thread-safe. The caller must ensure that these two API functions are not invoked simultaneously from different threads.</dd></dl>
<dl class="section return"><dt>Returns</dt><dd>CY_RSLT_SUCCESS on success; an error code on failure. </dd></dl>

</div>
</div>
<a id="ga186918ab7a9c658fb7e3cc6f00e0d6d9" name="ga186918ab7a9c658fb7e3cc6f00e0d6d9"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga186918ab7a9c658fb7e3cc6f00e0d6d9">&#9670;&nbsp;</a></span>cy_tls_load_global_root_ca_certificates()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">cy_rslt_t cy_tls_load_global_root_ca_certificates </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>trusted_ca_certificates</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const uint32_t&#160;</td>
          <td class="paramname"><em>cert_length</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Initializes the global trusted RootCA certificates used for verifying certificates received during TLS handshake. </p>
<p >This function parses the RootCA certificate chain and converts it to the underlying TLS stack format. It also stores the converted RootCA in its internal memory. This function overrides previously loaded RootCA certificates.</p>
<ol type="1">
<li>If CY_SECURE_SOCKETS_PKCS_SUPPORT flag is disabled: a. RootCA attached to the context will take first preference. b. RootCA set as global will take the last preference.</li>
<li>If CY_SECURE_SOCKETS_PKCS_SUPPORT flag is enabled: a. By default, RootCA certificates which is provisioned to secure element will be used. b. If socket option CY_SOCKET_SO_ROOTCA_CERTIFICATE_LOCATION is set with value CY_SOCKET_ROOTCA_RAM then<ul>
<li>RootCA attached to the context will take first preference.</li>
<li>RootCA set as global will take the last preference.</li>
</ul>
</li>
</ol>
<dl class="section note"><dt>Note</dt><dd><a class="el" href="group__group__cy__tls__functions.html#ga186918ab7a9c658fb7e3cc6f00e0d6d9">cy_tls_load_global_root_ca_certificates</a> and <a class="el" href="group__group__cy__tls__functions.html#ga5e76c0d24388071a0ba60b38a9367bd0">cy_tls_release_global_root_ca_certificates</a> API functions are not thread-safe. The caller must ensure that these two API functions are not invoked simultaneously from different threads.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">trusted_ca_certificates</td><td>A chain of x509 certificates in PEM or DER format. It should be a null-terminated string. This chain of certificates comprise the public keys of the signing authorities. During the handshake, these public keys are used to verify the authenticity of the peer. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">cert_length</td><td>Length of the trusted RootCA certificates excluding the 'null' terminator. The buffer pointed by trusted_ca_certificates is treated as a byte stream.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>cy_rslt_t CY_RESULT_SUCCESS on success; an error code on failure. Important error codes related to this API function are: <br  />
 CY_RSLT_MODULE_TLS_BADARG <br  />
 CY_RSLT_MODULE_TLS_OUT_OF_HEAP_SPACE <br  />
 CY_RSLT_MODULE_TLS_PARSE_CERTIFICATE </dd></dl>

</div>
</div>
<a id="ga5e76c0d24388071a0ba60b38a9367bd0" name="ga5e76c0d24388071a0ba60b38a9367bd0"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga5e76c0d24388071a0ba60b38a9367bd0">&#9670;&nbsp;</a></span>cy_tls_release_global_root_ca_certificates()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">cy_rslt_t cy_tls_release_global_root_ca_certificates </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Releases the resources allocated by the <a class="el" href="group__group__cy__tls__functions.html#ga186918ab7a9c658fb7e3cc6f00e0d6d9">cy_tls_load_global_root_ca_certificates</a> API function. </p>
<dl class="section note"><dt>Note</dt><dd><a class="el" href="group__group__cy__tls__functions.html#ga186918ab7a9c658fb7e3cc6f00e0d6d9">cy_tls_load_global_root_ca_certificates</a> and <a class="el" href="group__group__cy__tls__functions.html#ga5e76c0d24388071a0ba60b38a9367bd0">cy_tls_release_global_root_ca_certificates</a> API functions are not thread-safe. The caller must ensure that these two API functions are not invoked simultaneously from different threads.</dd></dl>
<dl class="section return"><dt>Returns</dt><dd>cy_rslt_t CY_RESULT_SUCCESS on success; an error code on failure. </dd></dl>

</div>
</div>
<a id="ga3d2408681bbcea3b869cb5ae21cd0d5e" name="ga3d2408681bbcea3b869cb5ae21cd0d5e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga3d2408681bbcea3b869cb5ae21cd0d5e">&#9670;&nbsp;</a></span>cy_tls_create_identity()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">cy_rslt_t cy_tls_create_identity </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>certificate_data</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const uint32_t&#160;</td>
          <td class="paramname"><em>certificate_len</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>private_key</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>private_key_len</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void **&#160;</td>
          <td class="paramname"><em>tls_identity</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Creates an identity structure from the supplied certificate and private key. </p>
<ol type="1">
<li>If CY_SECURE_SOCKETS_PKCS_SUPPORT flag is disabled: a. TLS identity created using <a class="el" href="group__group__cy__tls__functions.html#ga3d2408681bbcea3b869cb5ae21cd0d5e">cy_tls_create_identity</a> and set to context using socket option <a class="el" href="group__group__secure__sockets__macros.html#gafa0ac839774a33feeb037dbb0c449cc3">CY_SOCKET_SO_TLS_IDENTITY</a> will be used for device certificate &amp; key</li>
<li>If CY_SECURE_SOCKETS_PKCS_SUPPORT flag is enabled: a. By default, device certificates &amp; private keys which are provisioned to secure element will be used. b. If socket option CY_SOCKET_SO_DEVICE_CERT_KEY_LOCATION is set with value CY_SOCKET_DEVICE_CERT_KEY_RAM then TLS identity created with <a class="el" href="group__group__cy__tls__functions.html#ga3d2408681bbcea3b869cb5ae21cd0d5e">cy_tls_create_identity</a> API and set to context using socket option <a class="el" href="group__group__secure__sockets__macros.html#gafa0ac839774a33feeb037dbb0c449cc3">CY_SOCKET_SO_TLS_IDENTITY</a> will be used.</li>
</ol>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">certificate_data</td><td>x509 certificate in PEM format. It should be a null-terminated string. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">certificate_len</td><td>Length of the certificate excluding the 'null' terminator. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">private_key</td><td>Private key in PEM format. It should be a null-terminated string. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">private_key_len</td><td>Length of the private key excluding the 'null' terminator. </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">tls_identity</td><td>Pointer to a memory location containing the certificate and key in the underlying TLS stack format.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>CY_RSLT_SUCCESS on success; an error code on failure. Important error codes related to this API function are: <br  />
 CY_RSLT_MODULE_TLS_BADARG <br  />
 CY_RSLT_MODULE_TLS_OUT_OF_HEAP_SPACE <br  />
 CY_RSLT_MODULE_TLS_PARSE_CERTIFICATE <br  />
 CY_RSLT_MODULE_TLS_PARSE_KEY </dd></dl>

</div>
</div>
<a id="ga6e0540b152880d64f30eab5dfb33de2a" name="ga6e0540b152880d64f30eab5dfb33de2a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga6e0540b152880d64f30eab5dfb33de2a">&#9670;&nbsp;</a></span>cy_tls_delete_identity()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">cy_rslt_t cy_tls_delete_identity </td>
          <td>(</td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>tls_identity</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Releases resources allocated by the <a class="el" href="group__group__cy__tls__functions.html#ga3d2408681bbcea3b869cb5ae21cd0d5e">cy_tls_create_identity</a> API function. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">tls_identity</td><td>Pointer to a memory location containing the certificate and key in the underlying TLS stack format.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>CY_RSLT_SUCCESS on success; an error code on failure. Important error code related to this API function is: <br  />
 CY_RSLT_MODULE_TLS_BADARG </dd></dl>

</div>
</div>
<a id="gac85f731f94c63243c2cdff8a679bb10e" name="gac85f731f94c63243c2cdff8a679bb10e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gac85f731f94c63243c2cdff8a679bb10e">&#9670;&nbsp;</a></span>cy_tls_create_context()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">cy_rslt_t cy_tls_create_context </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__cy__tls__typedefs.html#ga0d99157c08499d8a8162a01bc60120fa">cy_tls_context_t</a> *&#160;</td>
          <td class="paramname"><em>context</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structcy__tls__params__t.html">cy_tls_params_t</a> *&#160;</td>
          <td class="paramname"><em>params</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Creates a TLS context structure from the input parameters. </p>
<p >It allocates a TLS context structure and stores the RootCA, TLS identity, send/receive callback functions, server name to be used in the SNI extension, protocol list to be added to the ALPN extension, and user context. TLS parameters provided by the user are used in later cy_tls API function calls. The memory holding the parameters should not be freed until completely done with using cy_tls API functions.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[out]</td><td class="paramname">context</td><td>Context handle returned by the TLS layer. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">params</td><td>TLS parameters specified by the caller such as the server certificate.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>CY_RSLT_SUCCESS on success; an error code on failure. Important error codes related to this API function are: <br  />
 CY_RSLT_MODULE_TLS_BADARG <br  />
 CY_RSLT_MODULE_TLS_OUT_OF_HEAP_SPACE </dd></dl>

</div>
</div>
<a id="gaff6995a44c8fbfb011bf2f06baa27941" name="gaff6995a44c8fbfb011bf2f06baa27941"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaff6995a44c8fbfb011bf2f06baa27941">&#9670;&nbsp;</a></span>cy_tls_connect()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">cy_rslt_t cy_tls_connect </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__cy__tls__typedefs.html#ga0d99157c08499d8a8162a01bc60120fa">cy_tls_context_t</a>&#160;</td>
          <td class="paramname"><em>context</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__group__cy__tls__enums.html#gae33f7537fb953f44173ea3b6a6a1e939">cy_tls_endpoint_type_t</a>&#160;</td>
          <td class="paramname"><em>endpoint</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>timeout</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Performs a TLS handshake and connects to the server. </p>
<p >RootCA certificate will be used for peer certificate verification as below:</p><ol type="1">
<li>If CY_SECURE_SOCKETS_PKCS_SUPPORT flag is disabled: a. By default, global RootCA certificate loaded will be used for verification. b. If context specific RootCA is set using CY_SOCKET_SO_TRUSTED_ROOTCA_CERTIFICATE socket option then context specific RootCA certificate will be used for verification.</li>
<li>If CY_SECURE_SOCKETS_PKCS_SUPPORT flag is enabled: a. By default, RootCA certificates which is provisioned to secure element will be used. b. If socket option CY_SOCKET_SO_ROOTCA_CERTIFICATE_LOCATION is set with value CY_SOCKET_ROOTCA_RAM then<ul>
<li>RootCA attached to the context will take first preference.</li>
<li>RootCA set as global will take the last preference.</li>
</ul>
</li>
</ol>
<p >Device certificate &amp; keys will be loaded as below:</p><ol type="1">
<li>If CY_SECURE_SOCKETS_PKCS_SUPPORT flag is disabled: a. If device certificate and keys are loaded by application/library using <a class="el" href="group__group__cy__tls__functions.html#ga3d2408681bbcea3b869cb5ae21cd0d5e">cy_tls_create_identity</a> API and TLS identity set using socket option CY_SOCKET_SO_TLS_IDENTITY will be used for device certificate and keys. 2.If CY_SECURE_SOCKETS_PKCS_SUPPORT flag is enabled: a. By default, device certificates and keys which are provisioned to secure element will be used. b. If socket option CY_SOCKET_SO_DEVICE_CERT_KEY_LOCATION is set with value CY_SOCKET_DEVICE_CERT_KEY_RAM then identity set to the TLS context will be used.</li>
</ol>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">context</td><td>Context handle for the TLS Layer created using <a class="el" href="group__group__cy__tls__functions.html#gac85f731f94c63243c2cdff8a679bb10e">cy_tls_create_context</a>. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">endpoint</td><td>Endpoint type for the TLS handshake. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">timeout</td><td>Maximum amount of time to wait in milliseconds to complete TLS connection. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>CY_RSLT_SUCCESS on success; an error code on failure. Important error code related to this API function is: <br  />
 CY_RSLT_MODULE_TLS_ERROR </dd></dl>

</div>
</div>
<a id="gaf9381a19e101fdb6e47373ecbbdbc446" name="gaf9381a19e101fdb6e47373ecbbdbc446"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaf9381a19e101fdb6e47373ecbbdbc446">&#9670;&nbsp;</a></span>cy_tls_send()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">cy_rslt_t cy_tls_send </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__cy__tls__typedefs.html#ga0d99157c08499d8a8162a01bc60120fa">cy_tls_context_t</a>&#160;</td>
          <td class="paramname"><em>context</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const unsigned char *&#160;</td>
          <td class="paramname"><em>data</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>length</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>timeout</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t *&#160;</td>
          <td class="paramname"><em>bytes_sent</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Encrypts the given data and sends it over a secure connection. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">context</td><td>Context handle for TLS Layer created using <a class="el" href="group__group__cy__tls__functions.html#gac85f731f94c63243c2cdff8a679bb10e">cy_tls_create_context</a>. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">data</td><td>Byte array of data to be encrypted and then sent to the network. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">length</td><td>Length in bytes of the write buffer. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">timeout</td><td>Maximum amount of time to wait in milliseconds to complete send operation. </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">bytes_sent</td><td>Number of bytes sent.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>CY_RSLT_SUCCESS on success; an error code on failure. On success, it also returns the number of bytes sent. Important error codes related to this API function are: <br  />
 CY_RSLT_MODULE_TLS_BADARG <br  />
 CY_RSLT_MODULE_TLS_ERROR </dd></dl>

</div>
</div>
<a id="ga9caa9d55b4be5c4f461c0efed063b068" name="ga9caa9d55b4be5c4f461c0efed063b068"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga9caa9d55b4be5c4f461c0efed063b068">&#9670;&nbsp;</a></span>cy_tls_recv()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">cy_rslt_t cy_tls_recv </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__cy__tls__typedefs.html#ga0d99157c08499d8a8162a01bc60120fa">cy_tls_context_t</a>&#160;</td>
          <td class="paramname"><em>context</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned char *&#160;</td>
          <td class="paramname"><em>buffer</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>length</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>timeout</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t *&#160;</td>
          <td class="paramname"><em>bytes_received</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Reads the encrypted data from the network, decrypts the data, and then stores it in the given buffer. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">context</td><td>Context handle for the TLS Layer created using <a class="el" href="group__group__cy__tls__functions.html#gac85f731f94c63243c2cdff8a679bb10e">cy_tls_create_context</a>. </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">buffer</td><td>Byte array to store the decrypted data received from the network. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">length</td><td>Length in bytes of the read buffer. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">timeout</td><td>Maximum amount of time to wait in milliseconds to complete receive operation. </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">bytes_received</td><td>Number of bytes received.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>CY_RSLT_SUCCESS on success; an error code on failure. On Success, it also returns the number of bytes received. Important error codes related to this API function are: <br  />
 CY_RSLT_MODULE_TLS_BADARG <br  />
 CY_RSLT_MODULE_TLS_ERROR </dd></dl>

</div>
</div>
<a id="ga7bec211e84f508f82ae2092e3bd19bbf" name="ga7bec211e84f508f82ae2092e3bd19bbf"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga7bec211e84f508f82ae2092e3bd19bbf">&#9670;&nbsp;</a></span>cy_tls_delete_context()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">cy_rslt_t cy_tls_delete_context </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__cy__tls__typedefs.html#ga0d99157c08499d8a8162a01bc60120fa">cy_tls_context_t</a>&#160;</td>
          <td class="paramname"><em>context</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Releases the resources allocated for the TLS connection. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">context</td><td>Context handle returned by the TLS Layer created using <a class="el" href="group__group__cy__tls__functions.html#gac85f731f94c63243c2cdff8a679bb10e">cy_tls_create_context</a>.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>CY_RSLT_SUCCESS on success; an error code on failure. Important error code related to this API function is: <br  />
 CY_RSLT_MODULE_TLS_BADARG </dd></dl>

</div>
</div>
<a id="gab7ffbf6231b73f5f44db70a6e3ac096a" name="gab7ffbf6231b73f5f44db70a6e3ac096a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gab7ffbf6231b73f5f44db70a6e3ac096a">&#9670;&nbsp;</a></span>cy_tls_config_cert_profile_param()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">cy_rslt_t cy_tls_config_cert_profile_param </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__cy__tls__enums.html#gad8adf739bb77cf42fd5e0b468c6677f6">cy_tls_md_type_t</a>&#160;</td>
          <td class="paramname"><em>mds_type</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__group__cy__tls__enums.html#ga050d16fa3dbe50238685202474ddbe71">cy_tls_rsa_min_key_len_t</a>&#160;</td>
          <td class="paramname"><em>rsa_bit_len</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Configures a custom certificate profile using the message digest and RSA min key length. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">mds_type</td><td>Message digest type. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">rsa_bit_len</td><td>Minimum RSA key length in bits.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>CY_RSLT_SUCCESS on success; an error code on failure. Important error code related to this API function is: <br  />
 CY_RSLT_MODULE_TLS_BADARG </dd></dl>

</div>
</div>
<a id="gaac4922e98264ecb5d6dee8a81ee77cf6" name="gaac4922e98264ecb5d6dee8a81ee77cf6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaac4922e98264ecb5d6dee8a81ee77cf6">&#9670;&nbsp;</a></span>cy_tls_is_certificate_valid_x509()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">cy_rslt_t cy_tls_is_certificate_valid_x509 </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>certificate_data</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const uint32_t&#160;</td>
          <td class="paramname"><em>certificate_len</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Checks if given buffer is in valid certificate format. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">certificate_data</td><td>x509 certificate in PEM format. It should be a null-terminated string. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">certificate_len</td><td>Length of the certificate excluding the 'null' terminator.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>CY_RSLT_SUCCESS on success; an error code on failure. </dd></dl>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath">
    <ul>
        <li class="footer">
            Generated for <b>Secure Sockets</b> by <b>Cypress Semiconductor Corporation</b>.
            All rights reserved.
        </li>
    </ul>
</div>
</body>
</html>
